package 动态数组.队列.测试;


import 动态数组.队列.ArrayDoubleEndStack;

public class TestArrayDoubleEndStack {
    public static void main(String[] args) {
        ArrayDoubleEndStack<Integer> doubleStack = new ArrayDoubleEndStack<>();
        for (int i = 1; i <= 5; i++) {
            doubleStack.leftPush(i);
        }
        System.out.println(doubleStack);
        for (int i = 6; i <= 10; i++) {
            doubleStack.rightPush(i);
        }
        System.out.println(doubleStack);
        doubleStack.rightPush(15);
        System.out.println(doubleStack);

        for (int i = 0; i < 6; i++) {
            System.out.println(doubleStack.rightPop());
            System.out.println(doubleStack);
        }
        System.out.println(doubleStack);
        ArrayDoubleEndStack<Integer> doubleStack1 = new ArrayDoubleEndStack<>();
        for (int i = 1; i < 6; i++) {
            doubleStack1.leftPush(i);
        }
        doubleStack1.rightPush(3);
        System.out.println(doubleStack1);
        System.out.println(doubleStack.equals(doubleStack1));
        for (Integer integer : doubleStack1) {
            System.out.println(integer);
        }

    }
}
